package com.woupla.model;

import java.io.Serializable;
import java.lang.Integer;
import java.lang.String;
import java.util.ArrayList;
import java.util.List;

import javax.enterprise.inject.New;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

/**
 * Entity implementation class for Entity: Company
 * 
 */
@NamedQueries(
		{ @NamedQuery(name = "findAllReg", query = "SELECT r FROM Region r ") ,
		 @NamedQuery(name = "findAllRegLike", query = "SELECT r FROM Region r where r.label like :reg") ,
		 @NamedQuery(name = "findRegLabel", query = "SELECT r FROM Region r where r.label = :reg")  }
		)
@Entity
public class Region implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4714055814360473722L;

	@Id
	@GeneratedValue
	private Integer id;

	@NotNull
	@NotEmpty
	private String label;
	@NotNull
	@NotEmpty
	private int codeRegion;
	@OneToMany
	private List<Departement>departements;
	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * @return the label
	 */
	public String getLabel() {
		return label;
	}
	/**
	 * @param label the label to set
	 */
	public void setLabel(String label) {
		this.label = label;
	}
	/**
	 * @return the codeRegion
	 */
	public int getCodeRegion() {
		return codeRegion;
	}
	/**
	 * @param codeRegion the codeRegion to set
	 */
	public void setCodeRegion(int codeRegion) {
		this.codeRegion = codeRegion;
	}
	/**
	 * @return the departements
	 */
	public List<Departement> getDepartements() {
		return departements;
	}
	/**
	 * @param departements the departements to set
	 */
	public void setDepartements(List<Departement> departements) {
		this.departements = departements;
	}

	
	
}
